import 'dart:async';

import 'package:get/get.dart';
import 'package:high_help_apps/common/routes/app_pages.dart';

import '../../../../global.dart';
import 'splash_welcome_state.dart';

class SplashWelcomeLogic extends GetxController {
  final state = SplashWelcomeState();

  @override
  void onReady() {
    super.onReady();
    initTimer();
  }

  Timer initTimer() => Timer(Duration(milliseconds: 1500), routeToOnBoardingPage);

  void routeToOnBoardingPage() {
    Get.offAndToNamed(AppRoutes.SIGN_IN);
    // if (Global.isOfflineLogin == true) {
    //   Get.offAndToNamed(AppRoutes.HOME_SCAFFOLD);
    // } else {
    //   Get.offAndToNamed(AppRoutes.SIGN_IN);
    // }
  }
}
